<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Contact WS CRUD Testing</title>
</head>
<body>
<?php

include '../testUtils.php';

$imsTestServer = "http://localhost:78/IMSTEST/";
//$imsTestServer = "http://imstest.gbif.org/"; 

//Create new record

	$doCreate = false;
			
	if ($doCreate)
	{

	$agent_id = 1971;
	$agent_type_id = 12;
    $name_short = 'Ringo';
    $name_full = 'Starr';
/*	$date_start = strip_tags($_REQUEST["date_start"]);
	$date_end = strip_tags($_REQUEST["date_start"]);
*/
			$titleID = 23;   //187, 189, 188
			$genderID = 23;  //22, 21
			$primaryRoleID = 23;  //148, 145, 146, 147
			$email = 'ringo@ringo.com';
			$telephone = '4124214';
			$mobile = '2143244';
			$imName = 'ringo';
			$imServiceID = 23; //
			$fax = '435235';
			$website = 'ringo.com';
	
		$createAgentUrl = getLink($imsTestServer."WS/Agent/AgentCreate.php",array(
		"agent_type_id"=>$agent_type_id,
		"name_short"=>$name_short,
		"name_full"=>$name_full,
		"title_id"=>$titleID,
		"gender_id"=>$genderID,
		"primary_role_id"=>$primaryRoleID,
		"email"=>$email,
		"telephone"=>$telephone,
		"mobile"=>$mobile,
		"im_name"=>$imName,
		"im_service_id"=>$imServiceID,
		"fax"=>$fax,
		"website"=>$website)
		);
		
		echo("<a href=$createAgentUrl>Create Contact</a>");
	}
	else 
	{
		$agent_id = '1971';
		$agent_type_id = '12';
    	$name_short = 'Elvis Aaron';
    	$name_full = 'Presley';
/*	$date_start = strip_tags($_REQUEST["date_start"]);
	$date_end = strip_tags($_REQUEST["date_start"]);
*/
			$titleID = '187';  //187, 189, 188
			$genderID = '23';  //22, 21
			$primaryRoleID = '148'; //148, 145, 146, 147
			$email = 'ep@elvis.com';
			$telephone = '5554214';
			$mobile = '5553244';
			$imName = 'ep';
			$imServiceID = '136';  //136, 134, 135, 133, 137
			$fax = '5552354';
			$website = 'elvis.com';
		
	$updateAgentUrl = getLink($imsTestServer."WS/Agent/AgentUpdate.php",array(
		"agent_id"=>$agent_id,
		"agent_type_id"=>$agent_type_id,
		"name_short"=>$name_short,
		"name_full"=>$name_full,
		"title_id"=>$titleID,
		"gender_id"=>$genderID,
		"primary_role_id"=>$primaryRoleID,
		"email"=>$email,
		"telephone"=>$telephone,
		"mobile"=>$mobile,
		"im_name"=>$imName,
		"im_service_id"=>$imServiceID,
		"fax"=>$fax,
		"website"=>$website)
		);	
		
		echo("<a href=$updateAgentUrl>Update Contact</a>");
	}
		
	$agent_type_id = 12;
    $name_short = 'Me';
	
		$searchPersonUrl = getLink($imsTestServer."WS/Agent/AgentSearch.php",array(
		"agent_type_id"=>$agent_type_id,
		"name_short"=>$name_short)
		);
		echo("<a href=$searchPersonUrl>Search Contact</a> <br>");

		$searchPeopleDetails = getLink($imsTestServer."WS/AgentSearch/PeopleSearch.php",array(
		"agent_id"=>1972)
		);
	
	
	
?>


		
</body>
</html>